function sum (a)
	local sum = 0
	for i = 1, #a do
		sum = sum + a[i]
	end
	return sum
end

-- test
table = {1, 2, 43, 3, 6, 6}
print("sum: " .. sum(table))
